package com.ygkj.demo

import android.content.Context
import android.util.Log
import androidx.work.Worker
import androidx.work.WorkerParameters

class DemoWorker(context: Context, workerParams: WorkerParameters) : Worker(context, workerParams) {

    init {
        var string = workerParams.inputData.getString("time")
        Log.d("doWork", "$string ...")
    }

    /**
     * 耗时操作
     * @return Result
     */
    override fun doWork(): Result {
        Log.d("doWork", "方法执行了...${Thread.currentThread().name}")
        return Result.success()
    }
}